<template>
  <div :style="{ ...styles }" class="position-full">
    <div v-if="widget.UI.data.type==='faceRecognition'" class="rect">
      <div class="rect-box"
           :style="{'top': widget.UI.data.recognitionRect.top+ 'px','left': widget.UI.data.recognitionRect.left+ 'px',
           'width': widget.UI.data.recognitionRect.width+ 'px','height': widget.UI.data.recognitionRect.height+ 'px'
           }"></div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'PlatformEZlink',
    props: {
      widget: {
        type: Object,
        default: () => {
          return {};
        }
      }
    },
    data() {
      return {};
    },
    computed: {
      state() {
        if (!this.widget || !this.widget.UI.state) return;
        return this.widget.getCurrentState();
      },
      styles() {
        const {rect = {}} = this.widget;
        const styles = {};
        const {height: sHeight = 0} = rect;
        sHeight && (styles.lineHeight = `${sHeight}px`);
        return styles;
      },
    },
  };
</script>

<style scoped lang="less">
  .rect {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .rect-box {
    position: absolute;
    top: 20px;
    width: 200px;
    height: 200px;
    border: 1px dashed #ccc;
  }
</style>
